<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <p id="hero">单击按钮给数组添加新的元素。</p>
    <button onclick="myFunction()">点我</button>
    <script>
        var heros = ['李白', '韩信', '宫本', '亚瑟', '后羿', '猴子'];
        function myFunction() {
            heros.push("哥们,你二臂吧")
            var x = document.getElementById("hero");
            x.innerHTML = heros;
        }
    </script>
</body>

</html>